/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;
import javax.swing.JInternalFrame;
/**
 *
 * @author morales
 */
public class afiliacion extends JInternalFrame {

    /**
     * Creates new form afiliacion
     */
    public afiliacion() {
        initComponents();
        setLocation(200,30);
        setIconifiable(true);
        rb_male.setEnabled(false);
        rb_famale.setEnabled(false);
        cmb_estrato.setEnabled(false);
        cmb_escolaridad.setEnabled(false);
        cmb_estadoCivil.setEnabled(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        rb_escolaridad = new javax.swing.JRadioButton();
        cmb_escolaridad = new javax.swing.JComboBox();
        cmb_estadoCivil = new javax.swing.JComboBox();
        rb_Estado_civil = new javax.swing.JRadioButton();
        rb_estrato = new javax.swing.JRadioButton();
        cmb_estrato = new javax.swing.JComboBox();
        rb_famale = new javax.swing.JRadioButton();
        rb_male = new javax.swing.JRadioButton();
        rb_sexo = new javax.swing.JRadioButton();
        cmd_consultar = new javax.swing.JButton();
        cmd_salir = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Afiliacion");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtro"));

        rb_escolaridad.setText("Escolaridad");
        rb_escolaridad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_escolaridadActionPerformed(evt);
            }
        });

        cmb_escolaridad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "----", "Tecnico", "universitario", "N/A" }));

        cmb_estadoCivil.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "----", "Soltero/a", "Casado/a", "Divorciado/a", "Viudo/a", "Separado/a" }));

        rb_Estado_civil.setText("Estado civil");
        rb_Estado_civil.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_Estado_civilActionPerformed(evt);
            }
        });

        rb_estrato.setText("Estrato");
        rb_estrato.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_estratoActionPerformed(evt);
            }
        });

        cmb_estrato.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-----", "1", "2", "3", "4", "5", "6" }));

        rb_famale.setText("Femenino");
        rb_famale.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_famaleActionPerformed(evt);
            }
        });

        rb_male.setText("Masculino");
        rb_male.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_maleActionPerformed(evt);
            }
        });

        rb_sexo.setText("Sexo");
        rb_sexo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_sexoActionPerformed(evt);
            }
        });

        cmd_consultar.setText("Consultar");

        cmd_salir.setText("Salir");
        cmd_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmd_salirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(39, 39, 39)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(rb_famale)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(rb_male)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(cmb_estrato, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(rb_sexo)
                                        .addGap(47, 47, 47)
                                        .addComponent(rb_estrato)))
                                .addGap(32, 32, 32)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(rb_Estado_civil)
                                    .addComponent(cmb_estadoCivil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(20, 20, 20)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(cmb_escolaridad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(rb_escolaridad)))
                            .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 404, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(112, 112, 112)
                        .addComponent(cmd_consultar)
                        .addGap(61, 61, 61)
                        .addComponent(cmd_salir, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rb_sexo)
                    .addComponent(rb_estrato)
                    .addComponent(rb_Estado_civil)
                    .addComponent(rb_escolaridad))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rb_male)
                    .addComponent(cmb_estrato, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cmb_estadoCivil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cmb_escolaridad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rb_famale)
                .addGap(18, 18, 18)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cmd_consultar)
                    .addComponent(cmd_salir))
                .addGap(34, 34, 34))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(25, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(40, 40, 40))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void rb_escolaridadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_escolaridadActionPerformed
        if(rb_escolaridad.isSelected())
        {
            rb_sexo.setEnabled(false);
            rb_estrato.setEnabled(false);
            rb_Estado_civil.setEnabled(false);
            cmb_estrato.setEnabled(false);
            cmb_estadoCivil.setEnabled(false);
            cmb_escolaridad.setEnabled(true);
            
        }
        else
        {
            rb_sexo.setEnabled(true);
            rb_estrato.setEnabled(true);
            rb_Estado_civil.setEnabled(true);
            cmb_estrato.setEnabled(false);
            cmb_escolaridad.setEnabled(false);
            cmb_estadoCivil.setEnabled(false);
                    }
    }//GEN-LAST:event_rb_escolaridadActionPerformed

    private void rb_Estado_civilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_Estado_civilActionPerformed
        if(rb_Estado_civil.isSelected())
        {
            rb_sexo.setEnabled(false);
            rb_estrato.setEnabled(false);
            rb_escolaridad.setEnabled(false);
            cmb_estrato.setEnabled(false);
            cmb_escolaridad.setEnabled(false);
            cmb_estadoCivil.setEnabled(true);
            
        }
        else
        {
            rb_sexo.setEnabled(true);
            rb_escolaridad.setEnabled(true);
            rb_estrato.setEnabled(true);
            cmb_estrato.setEnabled(false);
            cmb_escolaridad.setEnabled(false);
            cmb_estadoCivil.setEnabled(false);
            
        }
    }//GEN-LAST:event_rb_Estado_civilActionPerformed

    private void rb_estratoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_estratoActionPerformed
        if(rb_estrato.isSelected())
        {
            rb_sexo.setEnabled(false);
            rb_escolaridad.setEnabled(false);
            rb_Estado_civil.setEnabled(false);
            cmb_estrato.setEnabled(true);
            cmb_escolaridad.setEnabled(false);
            cmb_estadoCivil.setEnabled(false);
            
        }
        else
        {
            rb_sexo.setEnabled(true);
            rb_escolaridad.setEnabled(true);
            rb_Estado_civil.setEnabled(true);
            cmb_estrato.setEnabled(false);
            cmb_escolaridad.setEnabled(false);
            cmb_estadoCivil.setEnabled(false);
            
        }
    }//GEN-LAST:event_rb_estratoActionPerformed

    private void rb_famaleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_famaleActionPerformed
        if(rb_famale.isSelected())
        {
            rb_male.setEnabled(false);
        }
        else {
            rb_male.setEnabled(true);
        }
    }//GEN-LAST:event_rb_famaleActionPerformed

    private void rb_maleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_maleActionPerformed
        if(rb_male.isSelected())
        {
            rb_famale.setEnabled(false);
        }
        else {
            rb_famale.setEnabled(true);
        }
    }//GEN-LAST:event_rb_maleActionPerformed

    private void rb_sexoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_sexoActionPerformed
        if(rb_sexo.isSelected())
        {
            rb_male.setEnabled(true);
            rb_famale.setEnabled(true);
            rb_estrato.setEnabled(false);
            rb_escolaridad.setEnabled(false);
            rb_Estado_civil.setEnabled(false);
            cmb_estrato.setEnabled(false);
            cmb_escolaridad.setEnabled(false);
            cmb_estadoCivil.setEnabled(false);
            
        }
        else
        {
            rb_male.setEnabled(false);
            rb_famale.setEnabled(false);
            rb_estrato.setEnabled(true);
            rb_escolaridad.setEnabled(true);
            rb_Estado_civil.setEnabled(true);
            cmb_estrato.setEnabled(false);
            cmb_escolaridad.setEnabled(false);
            cmb_estadoCivil.setEnabled(false);
         }
    }//GEN-LAST:event_rb_sexoActionPerformed

    private void cmd_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmd_salirActionPerformed
        this.dispose();
    }//GEN-LAST:event_cmd_salirActionPerformed

    /**
     * @param args the command line arguments
     */
//    public static void main(String args[]) {
//        /* Set the Nimbus look and feel */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
//         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(afiliacion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(afiliacion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(afiliacion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(afiliacion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /* Create and display the form */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new afiliacion().setVisible(true);
//            }
//        });
//    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cmb_escolaridad;
    private javax.swing.JComboBox cmb_estadoCivil;
    private javax.swing.JComboBox cmb_estrato;
    private javax.swing.JButton cmd_consultar;
    private javax.swing.JButton cmd_salir;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JRadioButton rb_Estado_civil;
    private javax.swing.JRadioButton rb_escolaridad;
    private javax.swing.JRadioButton rb_estrato;
    private javax.swing.JRadioButton rb_famale;
    private javax.swing.JRadioButton rb_male;
    private javax.swing.JRadioButton rb_sexo;
    // End of variables declaration//GEN-END:variables
}
